<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>avalon: E:/avalon/src/libavalon/connect_pool.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">avalon
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_f51b14f5b402f75e5fe3fdf41b0bea7b.html">libavalon</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">connect_pool.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#ifndef CONNECT_POOL_H_</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="preprocessor">#define CONNECT_POOL_H_</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="keyword">class </span><a class="code hl_class" href="class_connecter.html">Connecter</a>;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="keyword">class </span><a class="code hl_class" href="class_provider.html">Provider</a>;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="keyword">class </span><a class="code hl_class" href="class_deliver.html">Deliver</a>;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="foldopen" id="foldopen00015" data-start="{" data-end="};">
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"><a class="line" href="class_connect_pool.html">   15</a></span><span class="keyword">class </span><a class="code hl_class" href="class_connect_pool.html">ConnectPool</a></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>{</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <span class="keyword">explicit</span> <a class="code hl_function" href="class_connect_pool.html#aa65c29a74c0cfbb6b1f2ba93b413bbd8">ConnectPool</a>(<span class="keyword">const</span> std::string &amp;amqp_address);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>    <a class="code hl_function" href="class_connect_pool.html#a97c432b8a39cca43799e33a0ff23c575">~ConnectPool</a>();</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_pool.html#af3660145a41de7291c40962f6f8dc9e4">init</a>(<span class="keywordtype">int</span> thread_num);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_pool.html#aef3cb55da5535dd190d3afa5ef453d41">addProvider</a>(<a class="code hl_class" href="class_provider.html">Provider</a> *provider);</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_pool.html#ad2678da26366a30b9c8fc3b02877cd13">dispatch</a>(<a class="code hl_class" href="class_deliver.html">Deliver</a> *deliver);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    std::string amqp_address_;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    std::vector&lt;Connecter *&gt; connecters_;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <span class="keywordtype">int</span> last_thread_index_;</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>};</div>
</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="preprocessor">#endif </span><span class="comment">// CONNECT_POOL_H_</span></div>
<div class="ttc" id="aclass_connect_pool_html"><div class="ttname"><a href="class_connect_pool.html">ConnectPool</a></div><div class="ttdoc">提供了连接池的功能，用于管理和异步化与消息代理的连接和通信。</div><div class="ttdef"><b>Definition</b> connect_pool.h:16</div></div>
<div class="ttc" id="aclass_connect_pool_html_a97c432b8a39cca43799e33a0ff23c575"><div class="ttname"><a href="class_connect_pool.html#a97c432b8a39cca43799e33a0ff23c575">ConnectPool::~ConnectPool</a></div><div class="ttdeci">~ConnectPool()</div><div class="ttdoc">析构函数，释放连接池中的所有资源。</div><div class="ttdef"><b>Definition</b> connect_pool.cpp:12</div></div>
<div class="ttc" id="aclass_connect_pool_html_aa65c29a74c0cfbb6b1f2ba93b413bbd8"><div class="ttname"><a href="class_connect_pool.html#aa65c29a74c0cfbb6b1f2ba93b413bbd8">ConnectPool::ConnectPool</a></div><div class="ttdeci">ConnectPool(const std::string &amp;amqp_address)</div><div class="ttdoc">构造函数，初始化连接池并设置AMQP地址。</div><div class="ttdef"><b>Definition</b> connect_pool.cpp:7</div></div>
<div class="ttc" id="aclass_connect_pool_html_ad2678da26366a30b9c8fc3b02877cd13"><div class="ttname"><a href="class_connect_pool.html#ad2678da26366a30b9c8fc3b02877cd13">ConnectPool::dispatch</a></div><div class="ttdeci">void dispatch(Deliver *deliver)</div><div class="ttdoc">分发消息到所有连接器。</div><div class="ttdef"><b>Definition</b> connect_pool.cpp:47</div></div>
<div class="ttc" id="aclass_connect_pool_html_aef3cb55da5535dd190d3afa5ef453d41"><div class="ttname"><a href="class_connect_pool.html#aef3cb55da5535dd190d3afa5ef453d41">ConnectPool::addProvider</a></div><div class="ttdeci">void addProvider(Provider *provider)</div><div class="ttdoc">添加消息提供者到连接池。</div><div class="ttdef"><b>Definition</b> connect_pool.cpp:41</div></div>
<div class="ttc" id="aclass_connect_pool_html_af3660145a41de7291c40962f6f8dc9e4"><div class="ttname"><a href="class_connect_pool.html#af3660145a41de7291c40962f6f8dc9e4">ConnectPool::init</a></div><div class="ttdeci">void init(int thread_num)</div><div class="ttdoc">初始化连接池，创建指定数量的工作线程。</div><div class="ttdef"><b>Definition</b> connect_pool.cpp:28</div></div>
<div class="ttc" id="aclass_connecter_html"><div class="ttname"><a href="class_connecter.html">Connecter</a></div><div class="ttdoc">定义一个连接器类，用于建立和维护与消息队列服务器的连接</div><div class="ttdef"><b>Definition</b> connecter.h:24</div></div>
<div class="ttc" id="aclass_deliver_html"><div class="ttname"><a href="class_deliver.html">Deliver</a></div><div class="ttdoc">类，用于处理消息的投递。</div><div class="ttdef"><b>Definition</b> deliver.h:40</div></div>
<div class="ttc" id="aclass_provider_html"><div class="ttname"><a href="class_provider.html">Provider</a></div><div class="ttdoc">服务提供者基类</div><div class="ttdef"><b>Definition</b> provider.h:24</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
